<script language="javascript" src="<?=$this->config->item('webroot')?>/js/ckeditor/ckeditor.js"></script>
<div style="padding:5px">
	<div class="border_frame">
		<div style="padding:10px;">
			<div style="float:left"><h2>Chi tiết</h2></div>
			<div class="toolbar">
				<ul>
					<li>
						<a href="javascript:" onclick="document.Data.submit()">
							<span class="save"> </span>Save
						</a>
					</li>
					<li>
						<a href="<?php echo $this->config->item('base_url')?>/admin/news">
							<span class="cancel"> </span>Cancel
						</a>
					</li>
				</ul>
				<div class="clear"></div>
			</div>
			<div class="clear"></div>
		</div>
	</div>
	<?php if(@$Error) :?>
		<br />
		<div class="error">
			<div class="child"><?php echo $Error?></div>
		</div>
	<?php endif;?>
	<div class="details">
		<iframe id="UploadImage" width="0" height="0" frameborder="0" name="UploadImage"></iframe>
		<table cellpadding="5" width="100%">
			<tr>
				<td width="120px" rowspan="4">
					<?php if(@$Item->TempAvatar) :?>
						<img src="<?php echo $this->config->item('data') , '/temp/' , @$Item->TempAvatar?>" class="avatar">
					<?php else :?>
						<img src="<?php echo $this->config->item('data') , '/img/' , @$Item->Avatar?>" class="avatar">
					<?php endif;?>
				</td>
				<td width="100px">Hình đại diện</td>
				<td>
					<form enctype="multipart/form-data" method="post" name="AvatarUpload" action="<?php echo $this->config->item('base_url')?>/admin/image" target="UploadImage">
						<input type="File" name="Avatar" onchange="document.AvatarUpload.submit()">
					</form>
				</td>
			</tr>
			<form action="" method="post" name="Data">
				<tr>
					<td>Tiêu đề</td>
					<td><textarea style="height:22px" name="Title"><?php echo @$Item->Title?></textarea></td>
				</tr>
				<tr>
					<td>Giới thiệu sơ lược</td>
					<td><textarea style="height:80px" name="Description"><?php echo @$Item->Description?></textarea></td>
				</tr>
				<tr>
					<td>Chuyên mục</td>
					<td>
						<select name="CategoryID">
							<option value="0">Chọn chuyên mục</option>
							<?php foreach($ListCategory as $Cat) :?>
								<option value="<?php echo $Cat->CategoryID?>" <?php if($Cat->CategoryID == @$Item->CategoryID) echo 'selected'?>><?php echo $Cat->CategoryName?></option>
							<?php endforeach;?>
						</select>
					</td>
				</tr>
				<tr>
					<td colspan="3"><h3>Nội dung</h3></td>
				</tr>
				<tr>
					<td colspan="3"><textarea name="Content" id="Content"><?php echo @$Item->Content?></textarea></td>
				</tr>
				<input type="hidden" name="Avatar" value="<?php echo @$Item->Avatar?>">
				<input type="hidden" name="NewsID" value="<?php echo @$Item->NewsID?>">
				<script language="javascript">
				$(function(){
					CKEDITOR.replace( 'Content',
					{
					filebrowserBrowseUrl :  '<?php echo $this->config->item('data')?>/ckfinder/ckfinder.html',
					filebrowserImageBrowseUrl : '<?php echo $this->config->item('data')?>/ckfinder/ckfinder.html?Type=Images',
					filebrowserFlashBrowseUrl : '<?php echo $this->config->item('data')?>/ckfinder/ckfinder.html?Type=Flash',
					filebrowserUploadUrl : '<?php echo $this->config->item('data')?>/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files',
					filebrowserImageUploadUrl : '<?php echo $this->config->item('data')?>/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images',
					filebrowserFlashUploadUrl :  '<?php echo $this->config->item('data')?>/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash'
					});
				})
				</script>
			</form>
		</table>
	</div>
</div>